<?php
//checking connection and connecting to a database
require_once('connection/config.php');
//Connect to mysql server
	$link = mysql_connect(DB_HOST, DB_USER, DB_PASSWORD);
	if(!$link) {
		die('Failed to connect to server: ' . mysql_error());
	}
	
	//Select database
	$db = mysql_select_db(DB_DATABASE);
	if(!$db) {
		die("Unable to select database");
	}
//retrive promotions from the specials table
$result=mysql_query("SELECT * FROM specials")
or die("There are no records to display ... \n" . mysql_error()); 
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"><html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>Pizza-Inn:Specials</title>
<script type="text/javascript" src="swf/swfobject.js"></script>
<link href="stylesheets/user_styles.css" rel="stylesheet" type="text/css">
</head>
<body>
<div id="page">
  <div id="menu"><ul>
  <li><a href="home.htm">Home</a></li>
  <li><a href="pizzazone.php">Pizza Zone</a></li>
  <li><a href="specialdeals.php">Special Deals</a></li>
  <li><a href="login-form.php">Login</a></li>
  <li><a href="register-form.php">Register</a></li>
  <li><a href="member-index.php">My Account</a></li>
  <li><a href="contactus.htm">Contact Us</a></li>
  </ul>
  </div>
<div id="header">
  <div id="logo"> <a href="home.htm" class="blockLink"></a></div>
  <div id="company_name">Pizza-Inn Restaurant</div>
</div>

<div id="center">

  <h1>SPECIAL DEALS</h1>
      
  <p>Check out our special deals below. These are for a limited time only. Make your decision now.</p>

  <div style="border:#bd6f2f solid 1px;padding:4px 6px 2px 6px">
<table width="700" align="center">
<CAPTION><h3>SPECIAL DEALS</h3></CAPTION>
<tr>
<th>Special Deal</th>
<th>Price</th>
<th>Start Date</th>
<th>End Date</th>
</tr>

<?php
//loop through all table rows
while ($row=mysql_fetch_array($result)){
echo "<tr>";
echo "<td>" . $row['special_name']."</td>";
echo "<td>" . $row['price']."</td>";
echo "<td>" . $row['start_date']."</td>";
echo "<td>" . $row['end_date']."</td>";
echo '<td><a href="order-exec.php?id=' . $row['specials_id'] . '">Order Now</a></td>';
echo "</tr>";
}
mysql_free_result($result);
mysql_close($link);
?>
</table>
  </div>
</div>
<div id="footer">
  <div class="bottom_menu"><a href="home.htm">Home Page</a>  |  <a href="aboutus.htm">About Us</a>  |  <a href="specialdeals.php">Special Deals</a>  |  <a href="pizzazone.htm">Pizza Zone</a>  |  <a href="#">Affiliate Program</a> |<br>
  | <a href="admin/index.php" target="_blank">Administrator</a> |</div>
  
  <div class="bottom_addr">&copy; 2012 Pizza-Inn. All Rights Reserved</div>
</div>
</div>

</body>
</html>
